package xiegd.study;

/**
 * @Author: xieguangda
 * @Description:
 * @Date: 2023/9/1 16:15
 */

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class Person {
    List<String> names;
    // 其他属性和方法

    // getter 和 setter
    public List<String> getNames() {
        return this.names;
    }
    public void setNames(List<String> names) {
        this.names = names;
    }
}

public class Main {
    public static void main(String[] args) {
        List<Person> people = new ArrayList<>();

        Person person = new Person();
        person.setNames(Arrays.asList("我是测试啊"));
        people.add(person);
        // 添加一些Person对象到people列表中...

//        List<MyObject> sortedList = people.stream()
//                .sorted(Comparator.comparing(Person::getNames).reversed())
//                .collect(Collectors.toList());

//        Comparator<Person> lengthComparator = Comparator.comparing(Person::getNames, Comparator.comparingInt(List::size).reversed());
//        people.sort(lengthComparator);
        // 现在，people列表将根据名称列表的长度进行排序（倒序）
    }
}
